             package com.java.diagnostics.visualizer.gc.realtimeV2.parser;
             
             import com.java.diagnostics.visualizer.data.TupleDataBuilder;
             
             public class StoredPoints
             {
               int storedPointsIndex;
               StoredPoint[] storedPoints;
               
               StoredPoints(int initialSize)
               {
                 resizeStored(initialSize);
               }
               
               void init() {
                 this.storedPointsIndex = 0;
               }
               
               boolean isEmpty() {
                 return this.storedPointsIndex == 0;
               }
               
               void storePoint(TupleDataBuilder data, double point, String comment) {
                 if (this.storedPointsIndex == this.storedPoints.length) {
                   resizeStored(this.storedPointsIndex + 2);
                 }
                 StoredPoint newPoint = this.storedPoints[(this.storedPointsIndex++)];
                 newPoint.data = data;
                 newPoint.point = point;
                 newPoint.comment = comment;
               }
               
               private void resizeStored(int newLen) {
                 StoredPoint[] tmp = new StoredPoint[newLen];
                 int prevLen;
                 if (this.storedPoints != null) {
                    prevLen = this.storedPoints.length;
                   System.arraycopy(this.storedPoints, 0, tmp, 0, prevLen);
                 } else {
                   prevLen = 0;
                 }
                 for (int i = prevLen; i < tmp.length; i++) {
                   tmp[i] = new StoredPoint();
                 }
                 this.storedPoints = tmp;
               }
               
               void complete() {
                 if (this.storedPointsIndex > 0) {
                   for (int i = 0; i < this.storedPointsIndex; i++) {
                     StoredPoint newPoint = this.storedPoints[i];
                     newPoint.data.addDataPoint(newPoint.point, newPoint.comment);
                   }
                   this.storedPointsIndex = 0;
                 }
               }
               
               private static class StoredPoint
               {
                 TupleDataBuilder data;
                 double point;
                 String comment;
               }
             }


